﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;

public partial class phone_GetNumber : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Write(FTchina.basic.SafeRequest(Request["tel"]));
        string date = FTchina.basic.SafeRequest(Request["t"]);




        Response.Write(GetDate(date).ToString());

    }

    /// <summary>
    /// 将控件传进来的时间格式化为系统时间
    /// </summary>
    /// <param name="date"></param>
    /// <returns></returns>
    protected DateTime GetDate(string date)
    {
        if (date.Length == 8)
        {
            int month = Convert.ToInt32(date.Substring(0, 2));
            int day = Convert.ToInt32(date.Substring(2, 2));
            int hour = Convert.ToInt32(date.Substring(4, 2));
            int min = Convert.ToInt32(date.Substring(6, 2));
            int year = DateTime.Now.Year;
            DateTime dt = new DateTime(year, month, day, hour, min, 0);

            return dt;
        }
        else
        {
            return DateTime.Now;
        }
    }
}